<?php

namespace app\validate;

use share\validate\SceneValidate;

class LoginValidate extends SceneValidate{
    protected $rule = [
        'isoCode' => 'require',
        'state' => 'require|min:16',
        'encode' => 'require|min:30',
        'email' => 'require|email|max:128',
        'phone' => 'require|number',
        'loginType' => 'require|max:64',
        'accessToken' => 'alphaNum|max:128',
        'password' => 'require|min:6',
        'verifyCode' => 'require|length:4,8',
        'language' => 'require',
        'account' => 'require',
        'vendor' => 'require',
        'location' => 'require|max:10',
        'phoneCode' => 'require|number',
        'packageName' => 'require|max:64',
        'userAccount' => 'require|max:64',
        'changeAccount' => 'require|max:64',
    ];    

    protected $sceneRules = [
        'sendBindCode' => [
            'isoCode' => 'require',
            'email' => 'email|max:128',
            'phone' => 'number',
            'phoneCode' => 'number',
            'loginType' => 'require|max:64',
            'accessToken' => 'alphaNum|max:128',
            'packageName' => 'require|max:64',
            'language' => 'require',
        ],
    ];

    protected $scene = [

        'getRegisterCode' => ['isoCode','account','accessToken','state','encode'],
        'getRegisterCodeV2' => ['language','account','packageName','accessToken','state','encode'],
        'getRegisterCodeV3' => ['language','location','account','packageName','accessToken','state','encode'],
        'getRegisterCodeV4' => ['language','location','packageName','accessToken','state','encode'],

        'register' => ['isoCode','account','password','verifyCode','state','encode'],
        'registerV2' => ['isoCode','location','account','password','verifyCode','state','encode'],
        'registerV3' => ['language','location','account','password','verifyCode','state','encode'],
        'registerV4' => ['language','location','password','verifyCode','packageName','state','encode'],
        'sendLoginCode' => ['accessToken','isoCode','packageName','language','state','encode'],


        'getResetCode' => ['isoCode','account','accessToken','state','encode'],
        'getResetCodeV2' => ['language','packageName','account','accessToken','state','encode'],

        'resetPswd' => ['isoCode','account','password','verifyCode','state','encode'],
        'resetPswdV2' => ['language','account','password','verifyCode','state','encode'],

        'sendBindCode' => ['loginType','isoCode','phone','phoneCode','email','language','packageName'],

        'bindingAccount' => ['loginType','isoCode','account','verifyCode','openId','state','encode'],

        'webLogin' => ['account','password'],
    ];
}